package com.smxy.mall.service;

import com.alibaba.fastjson.JSONObject;
import com.smxy.mall.entity.User;
import com.smxy.mall.model.Current;
import com.smxy.mall.model.request.user.DetailReq;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map;

public interface UserService {
    User saveFromUserName(String userName,String psw, Integer rolesId); //账号密码注册
    User findByUserNameAndUserPsw(String userName, String userPsw);

    User saveFromPhone(String phone, String psw); //手机号密码注册
    User findByPhoneAndUserPsw(String phone, String userPsw);

    Page<User> listByType(String type,Pageable pageable); //分页 用户列表，根据type
    Page<User> list(Pageable pageable);

    User findById(Integer id); //user信息

    User updateRoles(String roles,Integer userId);  //修改用户权限

    User save(User user); //
    User wxSave(JSONObject obj);

    User findByPhone(String phone);
    User findByOpenId(String openId);
    User userEdit(String sex, Current current);
    Map<String,Object> userCenter(Integer id);

    List<Object> getRoutes(Integer id);

    User edit(DetailReq detailReq); //修改用户
}
